package com.woniuxy.system.controller;


import com.woniuxy.resultCode.Result;
import com.woniuxy.system.entity.AssessmentType;
import com.woniuxy.system.service.AssessmentTemplateService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 考核模板 前端控制器
 * </p>
 *
 * @author woniuxy
 * @since 2022-06-08
 */
@RestController
@RequestMapping("/system/assessmentTemplate")
@RequiresAuthentication
public class AssessmentTemplateController {
@Autowired
    AssessmentTemplateService assessmentTemplateService;
@GetMapping("/getAssessmentTypeTree")
@RequiresRoles(value={"1","2","3"},logical = Logical.OR)
    Result getAssessmentTypeTree(){
    List<AssessmentType> assessmentTypeTree = assessmentTemplateService.getAssessmentTypeTree();
    return Result.ok().data("msg",assessmentTypeTree);
}


}

